package com.siyougame.business.controller.admin.inspectItemImg;

import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.*;

import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;

import com.siyougame.common.pojo.PageResult;
import com.siyougame.common.pojo.CommonResult;
import static com.siyougame.common.pojo.CommonResult.success;

import com.siyougame.common.utils.ExcelUtils;

import com.siyougame.common.annotation.OperateLog;
import static com.siyougame.common.enums.OperateTypeEnum.*;

import com.siyougame.business.controller.admin.inspectItemImg.vo.*;
import com.siyougame.business.dal.dataobject.inspectItemImg.InspectItemImgDO;
import com.siyougame.business.convert.inspectItemImg.InspectItemImgConvert;
import com.siyougame.business.service.inspectItemImg.InspectItemImgService;

@Api(tags = "管理后台 - 检查记录明细附件")
@RestController
@RequestMapping("/openapi/business/inspect-item-img")
@Validated
public class InspectItemImgController {

    @Resource
    private InspectItemImgService inspectItemImgService;

    //@PostMapping("/create")
    //@ApiOperation("创建检查记录明细附件")
    //@PreAuthorize("@ss.hasPermi('business:inspect-item-img:create')")
    //public CommonResult<Long> createInspectItemImg(@Valid @RequestBody InspectItemImgCreateReqVO createReqVO) {
    //    return success(inspectItemImgService.createInspectItemImg(createReqVO));
    //}
    //
    //@PutMapping("/update")
    //@ApiOperation("更新检查记录明细附件")
    //@PreAuthorize("@ss.hasPermi('business:inspect-item-img:edit')")
    //public CommonResult<Boolean> updateInspectItemImg(@Valid @RequestBody InspectItemImgUpdateReqVO updateReqVO) {
    //    inspectItemImgService.updateInspectItemImg(updateReqVO);
    //    return success(true);
    //}
    //
    //@DeleteMapping("/delete")
    //@ApiOperation("删除检查记录明细附件")
    //@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
    //@PreAuthorize("@ss.hasPermi('business:inspect-item-img:remove')")
    //public CommonResult<Boolean> deleteInspectItemImg(@RequestParam("id") Long id) {
    //    inspectItemImgService.deleteInspectItemImg(id);
    //    return success(true);
    //}
    //
    //@GetMapping("/get")
    //@ApiOperation("获得检查记录明细附件")
    //@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
    //@PreAuthorize("@ss.hasPermi('business:inspect-item-img:query')")
    //public CommonResult<InspectItemImgRespVO> getInspectItemImg(@RequestParam("id") Long id) {
    //    InspectItemImgDO inspectItemImg = inspectItemImgService.getInspectItemImg(id);
    //    return success(InspectItemImgConvert.INSTANCE.convert(inspectItemImg));
    //}

    @GetMapping("/list")
    @ApiOperation("获得检查记录明细附件列表")

    public CommonResult<List<InspectItemImgRespVO>> getInspectItemImgList(@RequestParam("ids") Collection<Long> ids) {
        List<InspectItemImgDO> list = inspectItemImgService.getInspectItemImgList(ids);
        return success(InspectItemImgConvert.INSTANCE.convertList(list));
    }
    //
    @GetMapping("/page")

    public CommonResult<PageResult<InspectItemImgRespVO>> getInspectItemImgPage(@Valid InspectItemImgPageReqVO pageVO) {
        PageResult<InspectItemImgDO> pageResult = inspectItemImgService.getInspectItemImgPage(pageVO);
        return success(InspectItemImgConvert.INSTANCE.convertPage(pageResult));
    }
    //
    //@GetMapping("/export-excel")
    //@ApiOperation("导出检查记录明细附件 Excel")
    //@PreAuthorize("@ss.hasPermi('business:inspect-item-img:export')")
    //@OperateLog(type = EXPORT)
    //public void exportInspectItemImgExcel(@Valid InspectItemImgExportReqVO exportReqVO,
    //          HttpServletResponse response) throws IOException {
    //    List<InspectItemImgDO> list = inspectItemImgService.getInspectItemImgList(exportReqVO);
    //    // 导出 Excel
    //    List<InspectItemImgExcelVO> datas = InspectItemImgConvert.INSTANCE.convertList02(list);
    //    ExcelUtils.write(response, "检查记录明细附件.xls", "数据", InspectItemImgExcelVO.class, datas);
    //}

}
